<?php 

class EventType{


	function getEventTypeData($eventTypeID){

		$ret = array();
		$DB = new DB();
		$con = $DB->conDB();
		$ret['debug'] .= "Start getEventTypeData <br>\n";

		if($eventTypeID > 0){
				
			$sql = "SELECT *
					FROM `EventTypes`
					WHERE EventTypeID = ".(int)$eventTypeID."
							";
			$ret['debug'] .= p($sql,1);
			$data = $DB->select($sql);
			
			$ret['data']  =$data;
				
			$ret['status'] = true;
		}
		else{
			$ret['status'] = "eventTypeID = 0";
		}

		$ret['debug'] .= "End getEventTypeData <br>\n";

		return $ret;

	}

	function calculateNextStartTimestamp($startTime, $startDay){
		$ret = array();
		$DB = new DB();
		$con = $DB->conDB();
		$ret['debug'] .= "Start calculateNextStartTimestamp <br>\n";
		if($startTime != "" AND $startDay != ""){
			
			$timestamp = strtotime("next ".$startDay." ".$startTime);
			
			$ret['data'] = $timestamp;
			$ret['status'] = true;
		}
		else{
			$ret['status'] = "startTime = 0 AND startDay = 0";
		}

		$ret['debug'] .= "End calculateNextStartTimestamp <br>\n";

		return $ret;
	}
	
}


?>